' Estimated using Eviews 7 or 8.
' Estimation code for model A with m_01 = m_02 = 0, and m_03 = 1
' Likelihood optimized using Marquardt optimization
' Note that compared to the results in the paper, these estimates are based on promotional dummies instead of (proprietary) promotional costs.
' As a consequence of this, the promotional effects and the day of the week effects are not well identified (due to collinearity).
' Note that starting values are important and that to obtain the maximum likelihood one needs to experiment with different starting values


' declare coefficient vectors
@param cc(1) 20000 cc(2) 1000 cc(3) 2000 cc(4) 2000 cc(5) .8 cc(6) .6 cc(7) -.8 cc(8) -.2 cc(9) -.2 cc(10) -.0  cc(12) -.1 cc(13) .1 cc(14) .1 cc(15) 5000 cc(16) 4000 cc(17) 16000 cc(18) 19000 cc(19) -2000 cc(20) -1000 cc(21) 0 cc(22) -1000 cc(23) 4000 cc(24) 6000 cc(25) 3000 cc(26) 30 cc(27) 2000 cc(29) 1000 cc(30) 1000 cc(31) 1001 cc(32) .001 cc(40) 10 cc(41) 1000 cc(42) 1000 cc(50) 10 cc(60) 1000  cc(70) -1 cc(80) -.1 cc(81) -.1 cc(82) -.1 c(11) 4000


Xb 	=  cc(1) + cc(2) * prom_entertainment + cc(3) * prom_giveaway + cc(4) * prom_kids + cc(5) * attendance(-1) + ( cc(12) - cc(5) * cc(4) ) * prom_kids(-1) + cc(15) * Season11 + cc(16) * season12 + cc(17) * opening11 + cc(18) * opening12 + cc(23) * day5 + cc(24) * day6 + cc(27) * day7 + cc(28) * july + cc(29) * august + cc(30) * sep + cc(31) * perf_wp + cc(32) * opp_distance + cc(50) * temp +  cc(60) * nattv + cc(80) * Control_entertainment + cc(81) * control_giveaway + cc(82) * control_kids - cc(5) * ( cc(15) * Season11(-1) + cc(16) * season12(-1) + cc(17) * opening11(-1) + cc(18) * opening12(-1) + cc(23) * day5(-1) + cc(24) * day6(-1) + cc(27) * day7(-1) + cc(28) * july(-1) + cc(29) * august(-1) + cc(30) * sep(-1) + cc(31) * perf_wp(-1) + cc(32) * opp_distance(-1) + cc(50) * temp(-1) + cc(60) * nattv(-1) + cc(80) * Control_entertainment(-1) + cc(81) * control_giveaway(-1) + cc(82) * control_kids(-1) ) 



res	= Attendance - Xb
resma	= res + ( cc(5) + cc(8) )* resma(-1)
stddev	= cc(11)


logl1	= log(@dnorm(resma/stddev)) - log(stddev^2)/2

@logl logl1












































































